// This fixes it so you can save collision groups

local function Collision(Entity, Copy, Save)
	if (Copy.CollisionGroup) then
		Copy.EntityMods = Copy.EntityMods or {}
		
		Copy.EntityMods.Collision = Copy.CollisionGroup
	end
end

ContraptionSaver.Hooks.Add("Save Entity", Collision)

// Register entity modifier

local function Register(Player, Entity, Group)
	Entity:SetCollisionGroup(Group)
	
	Entity.CollisionGroup = Group
end

duplicator.RegisterEntityModifier("Collision", Register)